-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Feat] DD Trace - Add instrumentation for streaming chunks #11338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds DataDog trace instrumentation for streaming chunks and updates tests to verify the new tracing behavior.
- Adds dd trace wrappers in the streaming generator (common_request_processing.py).
- Adds decorator-based dd tracing for completion endpoints (main.py).
- Updates tests and proxy configuration for new provider support and enhanced instrumentation.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/test_litellm/proxy/test_common_request_processing.py | New tests verifying dd trace wrapping for streaming responses. |
litellm/proxy/proxy_config.yaml | Updated configuration to support the OpenAI model alongside anthropic. |
litellm/proxy/common_request_processing.py | Implements dd trace instrumentation within the streaming generator. |
litellm/model_prices_and_context_window_backup.json | Adds configuration for the embed-v4.0 model. |
litellm/main.py | Applies dd trace decorators to streaming and synchronous completion functions. |
Comments suppressed due to low confidence (2)
tests/test_litellm/proxy/test_common_request_processing.py:291
- It appears that MagicMock is being used without an explicit import. Add 'from unittest.mock import MagicMock' to ensure the tests run correctly.
mock_tracer = MagicMock()
tests/test_litellm/proxy/test_common_request_processing.py:346
- It appears that MagicMock is being used without an explicit import in this test as well. Add 'from unittest.mock import MagicMock' to avoid NameError.
mock_tracer = MagicMock()
* fix: add tracing for litellm.completion * fix: NULL span add trace * fix: add tracing for litellm.completion streaming * fix: add tracing for litellm.completion streaming * fix: use a constant for str
…1338) * fix: add tracing for litellm.completion * fix: NULL span add trace * fix: add tracing for litellm.completion streaming * fix: add tracing for litellm.completion streaming * fix: use a constant for str
[Feat] DD Trace - Add instrumentation for streaming chunks
This PR adds DataDog trace instrumentation for streaming chunks and updates tests to verify the new tracing behavior.
After this PR
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
✅ Test
Changes